home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1362.dms / var1362.adf / c / SnoopDos.doc < prev    next >
Text File  |  1992-09-02  |  13KB  |  254 lines

  1.  
  2.                 SnoopDos V2.0 -- Monitors AmigaDOS function calls
  3.  
  4. INTRODUCTION
  5.  
  6.     Have you ever wondered why a particular program won't seem to run?
  7.     It could be looking for some special files which you've forgotten to
  8.     install in the appropriate place. SnoopDos was designed to let you
  9.     resolve situations like this, though it's probably useful for other
  10.     things too.
  11.  
  12.     For those who don't like long instruction files, simply run SnoopDos
  13.     with no options, then run a few application programs and look at the
  14.     output displayed in SnoopDos's window. Interesting, eh? For those who'd
  15.     like a more detailed explanation, read on...
  16.  
  17.     When you start SnoopDos, it opens a console window. In this window
  18.     appears details of all calls made by any program on the system to the
  19.     CurrentDir(), DeleteFile, Execute(), LoadSeg(), Lock() and Open()
  20.     functions in the AmigaDOS library. The exception (as usual) is any
  21.     program written in BCPL; this includes most of the commands in the C:
  22.     directory.
  23.  
  24.     SnoopDos will tell you about all attempts to load libraries, devices
  25.     and fonts. It will also tell you if a program looks for a specific file
  26.     (for example in S:) or a specific disk volume or directory. This can be
  27.     very useful when you're playing with new software which may require
  28.     certain fonts or other support files.
  29.  
  30.     An unexpected bonus is that since AmigaDOS environment variables are
  31.     stored as files, SnoopDos will tell you the names of any environment
  32.     variables a program tries to read; if you see references to ENV:<name>
  33.     in the SnoopDos window, then a program is trying to access an environment
  34.     variable called <name>.
  35.  
  36.  
  37. USAGE
  38.  
  39.     When you start SnoopDos, it automatically detaches itself from the CLI
  40.     and runs in the background. You can specify a number of options on the
  41.     command line, either at this time or later on by running SnoopDos again.
  42.     Each option can be given in lower case or upper case to respectively
  43.     enable or disable that setting. Alternatively, you can follow the option
  44.     by `1' or `0' which has the same effect. So, `-d' and `-d1' both enable
  45.     the "Monitor DeleteFile()" option, whereas `-d' and `-d0' both disable
  46.     that option. Without further ado, here's an explanation of each setting:
  47.  
  48.     -a  Normally, SnoopDos uses different colours when displaying messages,
  49.         to allow events to be easily distinguished from each other. You can
  50.         force SnoopDos not to use any colour by disabling this option. This
  51.         can be useful if you only have a 2-colour workbench. If SnoopDos is
  52.         sending its output to a file, it turns off this option by default
  53.         (but you can turn it back on again if you like).
  54.  
  55.     -c  When this option is enabled, SnoopDos prints details of all calls
  56.         to the CurrentDir() function. A program calls CurrentDir() when it
  57.         wants to change its current directory to somewhere else. Note that
  58.         no result is displayed for this function, since AmigaDOS does not
  59.         allow for the possibility of it ever failing.
  60.  
  61.     -d  This option allows you to see all calls to the DeleteFile() function,
  62.         which is called whenever a program wants to delete a file. This can
  63.         be useful with unknown programs, to make sure that they don't do
  64.         anything nasty (though in fairness, there are much more effective
  65.         ways for a rogue program to do damage than by deleting a few files).
  66.  
  67.     -f  When enabled, this option causes SnoopDos to print out the full
  68.         path names for files. For example, if a program's current directory
  69.         is SYS:TOOLS and it tries to open a file called FOO, then the
  70.         filename would be displayed as SYS:TOOLS/FOO. Normally, it would
  71.         just be displayed as FOO. Filenames which are so expanded are
  72.         prefixed by a `>' character. Filenames which already included a full
  73.         path specification don't have this prefix. This allows you to
  74.         determine if the calling program specified the full path or not.
  75.  
  76.     -g  This option enables or disables the monitoring of AmigaDOS's
  77.         LoadSeg() function. This is used to read in a binary loadfile and is
  78.         most commonly used for loading in libraries, devices, fonts and
  79.         handlers, and by third-party DOS shells to load in external commands.
  80.  
  81.     -l  This option enables or disables the monitoring of AmigaDOS's Lock()
  82.         function. Programs usually call this function to see if a particular
  83.         file exists, or as a prelude to some more sophisticated operation on
  84.         the file.
  85.  
  86.     -m  This option allows SnoopDos to be activated or deactivated while
  87.         still leaving it running. It is included merely for completeness;
  88.         a much easier way to achieve the same affect is to type CTRL-D or
  89.         CTRL-E in the SnoopDos window.
  90.  
  91.     -o  This option enables or disables the monitoring of AmigaDOS's Open()
  92.         function. Whenever a program wants to open a file for reading or
  93.         writing, it calls this function.
  94.  
  95.     -w  If several tasks try to call a particular DOS function at the same
  96.         time, SnoopDos can only handle them one at a time. Normally, what
  97.         will happen is that the other tasks speed on without waiting for
  98.         SnoopDos and you see a warning message saying that some function
  99.         calls were missed (this doesn't happen very often anyway). When the
  100.         `-w' option is enabled however, SnoopDos will make all the
  101.         different tasks queue up and take their turn.
  102.  
  103.         There is one important consequence of this: if a program tries to
  104.         access a file on a volume not currently mounted (causing AmigaDOS to
  105.         display a "Please insert volume xyzzy" requester), then SnoopDos will
  106.         print out the details about the file requested but not whether the
  107.         request succeeded or not; it can't do this until you respond to the
  108.         requester. In the meantime, other tasks may now be trying to call
  109.         AmigaDOS. For example, if you might try to pop open a new CLI with
  110.         Dmouse or PopCLI, so that you can do an ASSIGN to fake the requested
  111.         volume. All these tasks will have to wait until the original DOS
  112.         call has been completed.
  113.  
  114.         Since this can confuse things (though only for the user), the option
  115.         is disabled by default. You should only need it if you have to be
  116.         absolutely sure of catching every action made by several tasks.
  117.  
  118.     -x  This option enables or disables monitoring of Execute() calls.
  119.         Unlike most other DOS function calls, the return value from the
  120.         Execute() is NOT displayed; this is because when an Execute suceeds,
  121.         the command being executed will most likely making AmigaDOS calls of
  122.         of its own and if SnoopDos was waiting for Execute() to return, it
  123.         would skip printing these out.
  124.  
  125.         Some forms of Execute() will appear to have no associated command
  126.         to execute. This is normal, and occurs when a program redirects
  127.         command input from another file.
  128.  
  129.  
  130.     By default, Snoopdos operates as if you had started it with:
  131.  
  132.         SnoopDos -a1 -c1 -d1 -f0 -g1 -l0 -m1 -o1 -w0 -x1
  133.  
  134.     or for those who prefer to use the other command format:
  135.  
  136.         SnoopDos -a -c -d -F -g -L -m -o -w -x
  137.  
  138.     There are four additional options as well, which cause immediate
  139.     actions to be performed. These are:
  140.  
  141.     -h  Prints out a help screen for SnoopDos. Actually, typing any
  142.         unrecognised garbage after SnoopDos prints the help screen.
  143.  
  144.     -q  Sends a message to the version of SnoopDos currently running telling
  145.         it to remove itself. This is one way to quit SnoopDos, the other
  146.         way being to type CTRL-C in its window.
  147.  
  148.     -r  Prints out a brief report giving all the current settings for
  149.         SnoopDos (eagle-eyed users may spot a striking resemblance between
  150.         this display and the middle section of the help screen :-). Note
  151.         that all other command line options are ignored when you use -r.
  152.  
  153.     -z  Allows you to specify an alternative output file for SnoopDos to
  154.         send messages to. The filename can follow immediately after the -z,
  155.         or you can leave a space if you like.
  156.  
  157.         There are several uses for this function. First of all, you can use
  158.         it to change the location of the SnoopDos window when it opens, by
  159.         specifying a filename like -zCON:0/0/640/60/SnoopDos) (for a very
  160.         short window). You should always make sure the window is at least 77
  161.         columns wide or the output will look pretty messed up.
  162.  
  163.         If you specify -zSER: or -zAUX: then SnoopDos will send output to
  164.         the serial port at the baud rate specified in Preferences. AUX: is
  165.         slightly preferable to SER: since SnoopDos will then recognise the
  166.         CTRL-C, CTRL-D and CTRL-E characters when typed on the remote
  167.         terminal. If you are using a colour ANSI terminal, you may like to
  168.         re-enable colour by specifying `-a' in conjunction with this option.
  169.  
  170.         Finally, you can of course redirect output to a normal AmigaDOS file.
  171.         You would only want to do this if you wanted to keep a permanent
  172.         record of what went on on your system. This could be useful if you
  173.         allow remote access to your Amiga and want a record of what people
  174.         do on your system.
  175.  
  176.  
  177. THE SNOOPDOS WINDOW
  178.  
  179.     The SnoopDos window is divided into a number of columns, as follows:
  180.  
  181.     Process name
  182.         The name of the process (or CLI command) that is executing the
  183.         DOS call in question. If the DOS call is nested (see Res. below)
  184.         then the process name will be prefixed by '> '.
  185.  
  186.     Func
  187.         The function being executed (Open, Lock or Load). Open is printed
  188.         in white, Lock in orange and Load in black, to allow rows to be
  189.         quickly identifed at a glance. (Of course, if you've changed your
  190.         Preferences, the actual colours may be different.) Other values
  191.         which can appear here are Exec (for Execute), CD (for CurrentDir)
  192.         and Del (for DeleteFile).
  193.  
  194.     Filename
  195.         The name of the file being accessed. Remember that when the `-f'
  196.         option is enabled, this will be prefixed by a `>' character if the
  197.         filename displayed was expanded by SnoopDos to include the current
  198.         directory of the calling process.
  199.  
  200.     Mode
  201.         For Open(), this is OLD if an existing file is being opened or NEW
  202.         if a new file is being opened. For Lock(), this is SHAR if the lock
  203.         is a shared lock (i.e. several processes can access the same file) or
  204.         EXCL if it is an exclusive lock (only this process can access the
  205.         file). It remains empty for LoadSeg().
  206.  
  207.     Res.
  208.         The result of the DOS call. This is either `Okay' in white or
  209.         `Fail' in orange. In general, you learn much more from the `Fail'
  210.         entries (i.e. the things the program tried to find but couldn't).
  211.  
  212.         Occasionally, you may see a `>>>>' appearing here. This happens if
  213.         some other program has also patched DOS library in such a way that
  214.         the function currently being called calls another DOS function
  215.         itself. One such program is Rez, which tries to open a program file
  216.         for reading if you LoadSeg() it. In this case, the `>>>>' indicates
  217.         that DOS calls are being nested. The DOS calls which are nested
  218.         will have the associated process name prefixed by `> ' when they
  219.         are displayed. `> (Done)' is displayed when the top level DOS
  220.         function exits, and the exit status is displayed on the same
  221.         line in the Res. column as normal.
  222.  
  223.     You can type several keys into the SnoopDos window. CTRL-C will terminate
  224.     SnoopDos. CTRL-D will disable monitoring temporarily (and print a brief
  225.     message to that effect); CTRL-E enables it again. Pressing Space or any
  226.     other key will pause the output to the window, as in a CLI window. Press
  227.     BackSpace to continue. Note that if you have the `-w' option enabled and
  228.     you pause the output, all functions for which monitoring is enabled will
  229.     cause the calling process to go to sleep until you restart output again.
  230.  
  231.     When SnoopDos wants to quit, it makes sure that nobody else has patched
  232.     the DOS library after it. If something has, SnoopDos will refuse to exit
  233.     immediately. Instead, it will check approximately every 5 seconds to
  234.     see if it is safe to exit and as soon as it can, it will.
  235.  
  236.  
  237. AUTHOR
  238.  
  239.     Eddy Carroll
  240.  
  241.     Email:     ecarroll@maths.tcd.ie
  242.     Phone:     +353-1-874540
  243.     Snailmail: The Old Rectory, Delgany, Co. Wicklow, Ireland.
  244.     (C) Copyright Eddy Carroll, March 1993. Freely Distributable.
  245.  
  246. DISTRIBUTION
  247.  
  248.     SnoopDos may be freely distributed as long as no charge is made other
  249.     than to cover time and copying costs. If you want to include SnoopDos
  250.     as part of a commercial package (somehow I doubt it but it never hurts
  251.     to mention :-) then contact the author listed above. Fred Fish is
  252.     specifically given permission to include SnoopDos in his fine disk
  253.     collection.
  254.